package com.uniedp.modules.login;

import com.uniedp.core.utils.Result;
import com.uniedp.modules.security.dto.LoginDTO;
import com.uniedp.modules.security.utils.LoginUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @Package: com.uniedp.modules.login
 * @ClassName: LoginWithNoPassWord
 * @Description: 免密登录 入口检验
 * @Author: YJ
 * @CreateDate: 2019/7/29 10:10
 * @Version: 1.0
 */

@RestController
@Api(tags = "帆软登录")
public class FrLogin {


    @GetMapping("/open/api/frLogin")
    @ApiOperation(value = "帆软登录")
    public Result frLogin(HttpServletRequest request) throws Exception {

        FrLoginCheck.check(request);

        String username = request.getParameter("username");

        LoginDTO login = new LoginDTO();
        login.setUsername(username);

        return LoginUtils.getInstance().loginWithNoPassWord(request, login);

    }
}
